package com.aoasaa;

import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView; 
   
public class ChoosingTemplate extends Activity implements OnItemClickListener{
	/** Called when the activity is first created. */
	@Override         
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.choosingtemplatescreenfile);

		// creating the reference of the resource class which will be used to fetch the arrays of images and arrays of image names
				Resources res = getResources();  
		// creating reference to listview
		ListView v_choosetemplateLV=(ListView)findViewById(R.id.choosetemplateLV);
		v_choosetemplateLV.setAdapter(new ArrayAdapter(ChoosingTemplate.this, android.R.layout.simple_list_item_1, res.getStringArray(R.array.arry_chossetemplate)));
		v_choosetemplateLV.setOnItemClickListener(this);
 
	}

	@Override
	public void onItemClick(AdapterView<?> arg0, View v, int position, long arg3) {
		// TODO Auto-generated method stub
		switch(position)
		{
		case 0:
			Intent textIntent = new Intent(this, CreatingTextNotes.class);
	        startActivity(textIntent);
			break;
		case 1:
			Intent voiceIntent = new Intent(this, CreateVoiceNotes.class);
			 startActivity(voiceIntent);
			
			break;
		case 2:
			 Intent imageIntent = new Intent(this, CreatingImageNotes.class);
			 startActivity(imageIntent);
			break;
		default:
			break;
		}
	}
}
